function e(e) {
    var r = t.find(function(r) {
        return r.code === +e;
    });
    if (r) return r;
    throw new Error("不存在的version：" + e);
}

function r(n) {
    try {
        var t = e(n), o = [ t.code ];
        return t.upgrade && t.upgrade.forEach(function(e) {
            var n = r(e);
            o = o.concat(n);
        }), o;
    } catch (e) {
        return [];
    }
}

Object.defineProperty(exports, "__esModule", {
    value: !0
}), exports.VERSION = exports.getVersions = exports.getName = void 0;

var n = function(e) {
    return e && e.__esModule ? e : {
        default: e
    };
}(require("version")), t = [];

n.default.versions.filter(function(e) {
    return !e.suspended;
}).forEach(function(e) {
    return t.push(e);
}), function(e, r) {
    e.forEach(function(e) {
        0 !== e.code && e.contents.push("生成" + e.weapp + "个小程序"), e.contents = e.contents.map(function(e) {
            for (var r = /\$\{(.+?)\}/g, n = 0, t = [], o = void 0; o = r.exec(e); ) t.push({
                val: e.slice(n, o.index)
            }), n = o.index + o[0].length, t.push({
                style: "color: #50c74e;",
                val: o[1]
            });
            return n < e.length && t.push({
                val: e.slice(n, e.length)
            }), t;
        });
    });
}(t, n.default.modelContents);

var o = {
    SINGLE_PAGE: 0,
    COMPANY_DISPLAY: 3,
    CPMPANY_SITE: 1,
    SERVICE_ORDER: 4,
    COMPANY_E_COMMERCE: 2,
    FULL_FEATURE: 5
};

exports.getName = function(r) {
    try {
        return e(r).name;
    } catch (e) {
        return "未识别的版本";
    }
}, exports.getVersions = function(e) {
    if (e) {
        var n = r(e);
        return t.filter(function(e) {
            return n.includes(e.code);
        });
    }
    return t;
}, exports.VERSION = o;